﻿using System.Net.Http.Json;
using WebApplication1.Interface;

namespace BootstrapBlazorApp.Shared.Data;

/// <summary>
///
/// </summary>
public class WeatherForecastService : IWeatherForecastController
{
    private readonly HttpClient _httpClient;

    public WeatherForecastService(HttpClient httpClient)
    {
        _httpClient = httpClient;
    }
    public async Task<IEnumerable<WebApplication1.Dto.WeatherForecast>> Get()
    {
        return await _httpClient.GetFromJsonAsync<IEnumerable<WebApplication1.Dto.WeatherForecast>>("/WeatherForecast");
    }
}
